package xyz.csmcool.imchat.feignclient;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import xyz.csmcool.imutil.dto.RoomUserDto;
import xyz.csmcool.imutil.dto.RoomUsersDto;
import xyz.csmcool.imutil.dto.UserDto;
import xyz.csmcool.imutil.webVo.ResultVo;

import java.util.List;

/**
 * @author 什锦
 * @Package xyz.csmcool.imroom.feignclient
 * @since 2022/8/9 0:37
 */
@FeignClient(name="sjimUser",fallback = UserFileDefradeFeignClient.class)
@Component
public interface UserClient {

    /**
     * 获取用户信息
     * @param uid
     * @return
     */
    @PostMapping("/users/getInfo")
    ResultVo<UserDto> getUserInfo(@RequestParam("uid") String uid);

    /**
     * 获取房间用户
     * @param ids
     * @return
     */
    @PostMapping("/users/room-user")
    ResultVo<List<UserDto>> getRoomUserInfo(@RequestParam("userIdList") List<Integer> ids);
}
